#!/bin/bash

num1=1
num2=2
num3=1

test $num1 -eq $num2        #==
echo $?                     #1
[ $num1 -eq $num3 ]
echo $?                     #0

test $num1 -ne $num2        #0
echo $?
[ $num1 -ne $num3 ]         #1
echo $?

test $num1 -gt $num2        #>
echo $?                     #1
[ $num1 -gt $num3 ]
echo $?                     #1

test $num1 -ge $num2        #>=
echo $?                     #1
[ $num1 -ge $num3 ]
echo $?                     #0

test $num1 -lt $num2        #<
echo $?                     #0
[ $num1 -lt $num3 ]
echo $?                     #1

test $num1 -le $num2        #<=
echo $?                     #0
[ $num1 -le $num3 ]
echo $?                     #0


#数值比较总结
#   eq：==
#   gt：>
#   ge：>=
#   lt：<
#   le：<=